#include <asm.h>
#include <regdef.h>
#include <new_inst_test.h>

LEAF(my23_beql_test)
    .set noreorder
    addiu s0,s0,1
    li    s2,0

###test inst
    TEST_BEQ_LIKE(0x47233,0x11003,beql_not_jump_0,beql_jump_0);
    TEST_BEQ_LIKE(0x3eb3a,0xfffc955,beql_not_jump_1,beql_jump_1);
    TEST_BEQ_LIKE(0x23ae1,0x12532,beql_not_jump_2,beql_jump_2);
    TEST_BEQ_LIKE(0x47705,0xfffffbd9,beql_not_jump_3,beql_jump_3);
    TEST_BEQ_LIKE(0xffffd430,0xb7039,beql_not_jump_4,beql_jump_4);
    TEST_BEQ_LIKE(0x4421b,0x13320,beql_not_jump_5,beql_jump_5);
    TEST_BEQ_LIKE(0xfffff60a,0x35e294,beql_not_jump_6,beql_jump_6);
    TEST_BEQ_LIKE(0x36911,0xb7039,beql_not_jump_7,beql_jump_7);
###detect exception
    bne s2,zero,inst_error
    nop
###score ++
    addiu s3, s3, 1
###output (s0<<24)|s3
test:
    beq s0,s3,inst_error
    nop
    addiu s3,s3,1
    j test
    nop
inst_error:
    sll t1, s0, 24
    or t0, t1, s3
    sw t0, 0(s1)

    jr ra
    nop
END(my23_beql_test)
